home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / a_man / cat7 / log.z / log
Encoding:
Text File  |  2002-10-03  |  20.4 KB  |  260 lines

  1.  
  2.  
  3.  
  4. lllloooogggg((((7777))))                                                                  lllloooogggg((((7777))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      _llll_oooo_gggg - interface to STREAMS error logging and event tracing
  10.  
  11. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  12.      _llll_oooo_gggg is a STREAMS software device driver that provides an interface for
  13.      console logging and for the STREAMS error logging and event tracing
  14.      processes [_ssss_tttt_rrrr_eeee_rrrr_rrrr(1M), _ssss_tttt_rrrr_aaaa_cccc_eeee(1M)].  _llll_oooo_gggg presents two separate
  15.      interfaces: a function call interface in the kernel through which STREAMS
  16.      drivers and modules submit _llll_oooo_gggg messages; and a subset of _iiii_oooo_cccc_tttt_llll(2) system
  17.      calls and STREAMS messages for interaction with a user level console
  18.      logger, an error logger, a trace logger, or processes that need to submit
  19.      their own _llll_oooo_gggg messages.
  20.  
  21.    KKKKeeeerrrrnnnneeeellll IIIInnnntttteeeerrrrffffaaaacccceeee
  22.      _llll_oooo_gggg messages are generated within the kernel by calls to the function
  23.      _ssss_tttt_rrrr_llll_oooo_gggg:
  24.  
  25.           _ssss_tttt_rrrr_llll_oooo_gggg_((((_mmmm_iiii_dddd_,,,, _ssss_iiii_dddd_,,,, _llll_eeee_vvvv_eeee_llll_,,,, _ffff_llll_aaaa_gggg_ssss_,,,, _ffff_mmmm_tttt_,,,, _aaaa_rrrr_gggg_1111_,,,, _...._...._...._))))
  26.           _ssss_hhhh_oooo_rrrr_tttt _mmmm_iiii_dddd_,,,, _ssss_iiii_dddd_;;;;
  27.           _cccc_hhhh_aaaa_rrrr _llll_eeee_vvvv_eeee_llll_;;;;
  28.           _uuuu_ssss_hhhh_oooo_rrrr_tttt _ffff_llll_aaaa_gggg_ssss_;;;;
  29.           _cccc_hhhh_aaaa_rrrr _****_ffff_mmmm_tttt_;;;;
  30.           _uuuu_nnnn_ssss_iiii_gggg_nnnn_eeee_dddd _aaaa_rrrr_gggg_1111_;;;;
  31.  
  32.      Required definitions are contained in _<<<<_ssss_yyyy_ssss_////_ssss_tttt_rrrr_llll_oooo_gggg_...._hhhh_>>>>, _<<<<_ssss_yyyy_ssss_////_llll_oooo_gggg_...._hhhh_>>>>, and
  33.      _<<<<_ssss_yyyy_ssss_////_ssss_yyyy_ssss_llll_oooo_gggg_...._hhhh_>>>>.  _m_i_d is the STREAMS module id number for the module or
  34.      driver submitting the _llll_oooo_gggg message.  _s_i_d is an internal sub-id number
  35.      usually used to identify a particular minor device of a driver.  _l_e_v_e_l is
  36.      a tracing level that allows for selective screening out of low priority
  37.      messages from the tracer.  _f_l_a_g_s are any combination of _SSSS_LLLL______EEEE_RRRR_RRRR_OOOO_RRRR (the
  38.      message is for the error logger), _SSSS_LLLL______TTTT_RRRR_AAAA_CCCC_EEEE (the message is for the
  39.      tracer), _SSSS_LLLL______CCCC_OOOO_NNNN_SSSS_OOOO_LLLL_EEEE (the message is for the console logger), _SSSS_LLLL______FFFF_AAAA_TTTT_AAAA_LLLL
  40.      (advisory notification of a fatal error), and _SSSS_LLLL______NNNN_OOOO_TTTT_IIII_FFFF_YYYY (request that a
  41.      copy of the message be mailed to the system administrator).  _f_m_t is a
  42.      _pppp_rrrr_iiii_nnnn_tttt_ffff(3S) style format string, except that %s, %e, %E, %g, and %G
  43.      conversion specifications are not handled.  Up to _NNNN_LLLL_OOOO_GGGG_AAAA_RRRR_GGGG_SSSS (currently 3)
  44.      numeric or character arguments can be provided.
  45.  
  46.    UUUUsssseeeerrrr IIIInnnntttteeeerrrrffffaaaacccceeee
  47.      _llll_oooo_gggg is opened via the _cccc_llll_oooo_nnnn_eeee interface, _////_dddd_eeee_vvvv_////_llll_oooo_gggg.  Each open of _////_dddd_eeee_vvvv_////_llll_oooo_gggg
  48.      obtains a separate stream to _llll_oooo_gggg.  In order to receive _llll_oooo_gggg messages, a
  49.      process must first notify _llll_oooo_gggg whether it is an error logger, trace
  50.      logger, or console logger via a STREAMS _IIII______SSSS_TTTT_RRRR _iiii_oooo_cccc_tttt_llll call (see below).
  51.      For the console logger, the _IIII______SSSS_TTTT_RRRR _iiii_oooo_cccc_tttt_llll has an _iiii_cccc______cccc_mmmm_dddd field of _IIII______CCCC_OOOO_NNNN_SSSS_LLLL_OOOO_GGGG,
  52.      with no accompanying data.  For the error logger, the _IIII______SSSS_TTTT_RRRR _iiii_oooo_cccc_tttt_llll has an
  53.      _iiii_cccc______cccc_mmmm_dddd field of _IIII______EEEE_RRRR_RRRR_LLLL_OOOO_GGGG, with no accompanying data.  For the trace
  54.      logger, the _iiii_oooo_cccc_tttt_llll has an _iiii_cccc______cccc_mmmm_dddd field of _IIII______TTTT_RRRR_CCCC_LLLL_OOOO_GGGG, and must be
  55.      accompanied by a data buffer containing an array of one or more struct
  56.      _tttt_rrrr_aaaa_cccc_eeee______iiii_dddd_ssss elements.  Each _tttt_rrrr_aaaa_cccc_eeee______iiii_dddd_ssss structure specifies an _m_i_d, _s_i_d, and
  57.      _l_e_v_e_l from which message will be accepted.  _ssss_tttt_rrrr_llll_oooo_gggg will accept messages
  58.      whose _m_i_d and _s_i_d exactly match those in the _tttt_rrrr_aaaa_cccc_eeee______iiii_dddd_ssss structure, and
  59.      whose level is less than or equal to the level given in the _tttt_rrrr_aaaa_cccc_eeee______iiii_dddd_ssss
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. lllloooogggg((((7777))))                                                                  lllloooogggg((((7777))))
  71.  
  72.  
  73.  
  74.      structure.  A value of -1 in any of the fields of the _tttt_rrrr_aaaa_cccc_eeee______iiii_dddd_ssss structure
  75.      indicates that any value is accepted for that field.
  76.  
  77.      Once the logger process has identified itself via the _iiii_oooo_cccc_tttt_llll call, _llll_oooo_gggg
  78.      will begin sending up messages subject to the restrictions noted above.
  79.      These messages are obtained via the _gggg_eeee_tttt_mmmm_ssss_gggg_((((_2222_)))) system call.  The control
  80.      part of this message contains a _llll_oooo_gggg______cccc_tttt_llll structure, which specifies the
  81.      _m_i_d, _s_i_d, _l_e_v_e_l, _f_l_a_g_s, time in ticks since boot that the message was
  82.      submitted, the corresponding time in seconds since Jan. 1, 1970, a
  83.      sequence number, and a priority.  The time in seconds since 1970 is
  84.      provided so that the date and time of the message can be easily computed,
  85.      and the time in ticks since boot is provided so that the relative timing
  86.      of _llll_oooo_gggg messages can be determined.
  87.  
  88.      The priority is comprised of a priority code and a facility code, found
  89.      in _<<<<_ssss_yyyy_ssss_////_ssss_yyyy_ssss_llll_oooo_gggg_...._hhhh_>>>>.  If _SSSS_LLLL______CCCC_OOOO_NNNN_SSSS_OOOO_LLLL_EEEE is set in _f_l_a_g_s, the priority code is
  90.      set as follows. If _SSSS_LLLL______WWWW_AAAA_RRRR_NNNN is set, the priority code is set to
  91.      _LLLL_OOOO_GGGG______WWWW_AAAA_RRRR_NNNN_IIII_NNNN_GGGG.  If _SSSS_LLLL______FFFF_AAAA_TTTT_AAAA_LLLL is set, the priority code is set to _LLLL_OOOO_GGGG______CCCC_RRRR_IIII_TTTT.
  92.      If _SSSS_LLLL______EEEE_RRRR_RRRR_OOOO_RRRR is set, the priority code is set to _LLLL_OOOO_GGGG______EEEE_RRRR_RRRR.  If _SSSS_LLLL______NNNN_OOOO_TTTT_EEEE is
  93.      set, the priority code is set to _LLLL_OOOO_GGGG______NNNN_OOOO_TTTT_IIII_CCCC_EEEE.  If _SSSS_LLLL______TTTT_RRRR_AAAA_CCCC_EEEE is set, the
  94.      priority code is set to _LLLL_OOOO_GGGG______DDDD_EEEE_BBBB_UUUU_GGGG.  If only _SSSS_LLLL______CCCC_OOOO_NNNN_SSSS_OOOO_LLLL_EEEE is set, the
  95.      priority code is set to _LLLL_OOOO_GGGG______IIII_NNNN_FFFF_OOOO. Messages originating from the kernel
  96.      have the facility code set to _LLLL_OOOO_GGGG______KKKK_EEEE_RRRR_NNNN. Most messages originating from
  97.      user processes will have the facility code set to _LLLL_OOOO_GGGG______UUUU_SSSS_EEEE_RRRR.
  98.  
  99.      Different sequence numbers are maintained for the error and trace logging
  100.      streams, and are provided so that gaps in the sequence of messages can be
  101.      determined (during times of high message traffic some messages may not be
  102.      delivered by the logger to avoid hogging system resources).  The data
  103.      part of the message contains the unexpanded text of the format string
  104.      (null terminated), followed by _NNNN_LLLL_OOOO_GGGG_AAAA_RRRR_GGGG_SSSS words for the arguments to the
  105.      format string, aligned on the first word boundary following the format
  106.      string.
  107.  
  108.      A process may also send a message of the same structure to _llll_oooo_gggg, even if
  109.      it is not an error or trace logger.  The only fields of the _llll_oooo_gggg______cccc_tttt_llll
  110.      structure in the control part of the message that are accepted are the
  111.      _l_e_v_e_l, _f_l_a_g_s, and _p_r_i fields; all other fields are filled in by _llll_oooo_gggg
  112.      before being forwarded to the appropriate logger.  The data portion must
  113.      contain a null terminated format string, and any arguments (up to
  114.      _NNNN_LLLL_OOOO_GGGG_AAAA_RRRR_GGGG_SSSS) must be packed one word each, on the next word boundary
  115.      following the end of the format string.
  116.  
  117.      _EEEE_NNNN_XXXX_IIII_OOOO is returned for _IIII______TTTT_RRRR_CCCC_LLLL_OOOO_GGGG _iiii_oooo_cccc_tttt_lllls without any _tttt_rrrr_aaaa_cccc_eeee______iiii_dddd_ssss structures,
  118.      or for any unrecognized _IIII______SSSS_TTTT_RRRR _iiii_oooo_cccc_tttt_llll calls.  Incorrectly formatted _llll_oooo_gggg
  119.      messages sent to the driver by a user process are silently ignored (no
  120.      error results).
  121.  
  122.      Processes that wish to write a message to the console logger may direct
  123.      their output to _////_dddd_eeee_vvvv_////_cccc_oooo_nnnn_ssss_llll_oooo_gggg, using either _wwww_rrrr_iiii_tttt_eeee(2) or _pppp_uuuu_tttt_mmmm_ssss_gggg(2).
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. lllloooogggg((((7777))))                                                                  lllloooogggg((((7777))))
  137.  
  138.  
  139.  
  140. EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
  141.      Example of _IIII______EEEE_RRRR_RRRR_LLLL_OOOO_GGGG notification.
  142.  
  143.           _ssss_tttt_rrrr_uuuu_cccc_tttt _ssss_tttt_rrrr_iiii_oooo_cccc_tttt_llll _iiii_oooo_cccc_;;;;
  144.           _iiii_oooo_cccc_...._iiii_cccc______cccc_mmmm_dddd _==== _IIII______EEEE_RRRR_RRRR_LLLL_OOOO_GGGG_;;;;
  145.           _iiii_oooo_cccc_...._iiii_cccc______tttt_iiii_mmmm_oooo_uuuu_tttt _==== _0000_;;;;  _////_**** _dddd_eeee_ffff_aaaa_uuuu_llll_tttt _tttt_iiii_mmmm_eeee_oooo_uuuu_tttt _((((_1111_5555 _ssss_eeee_cccc_ssss_...._)))) _****_////
  146.           _iiii_oooo_cccc_...._iiii_cccc______llll_eeee_nnnn _==== _0000_;;;;
  147.           _iiii_oooo_cccc_...._iiii_cccc______dddd_pppp _==== _NNNN_UUUU_LLLL_LLLL_;;;;
  148.           _iiii_oooo_cccc_tttt_llll_((((_llll_oooo_gggg_,,,, _IIII______SSSS_TTTT_RRRR_,,,, _&&&&_iiii_oooo_cccc_))))_;;;;
  149.  
  150.      Example of _IIII______TTTT_RRRR_CCCC_LLLL_OOOO_GGGG notification.
  151.  
  152.           _ssss_tttt_rrrr_uuuu_cccc_tttt _tttt_rrrr_aaaa_cccc_eeee______iiii_dddd_ssss _tttt_iiii_dddd_[[[[_2222_]]]]_;;;;
  153.           _tttt_iiii_dddd_[[[[_0000_]]]]_...._tttt_iiii______mmmm_iiii_dddd _==== _2222_;;;;
  154.           _tttt_iiii_dddd_[[[[_0000_]]]]_...._tttt_iiii______ssss_iiii_dddd _==== _0000_;;;;
  155.           _tttt_iiii_dddd_[[[[_0000_]]]]_...._tttt_iiii______llll_eeee_vvvv_eeee_llll _==== _1111_;;;;
  156.           _tttt_iiii_dddd_[[[[_1111_]]]]_...._tttt_iiii______mmmm_iiii_dddd _==== _1111_0000_0000_2222_;;;;
  157.           _tttt_iiii_dddd_[[[[_1111_]]]]_...._tttt_iiii______ssss_iiii_dddd _==== _----_1111_;;;; _////_**** _aaaa_nnnn_yyyy _ssss_uuuu_bbbb_----_iiii_dddd _wwww_iiii_llll_llll _bbbb_eeee _aaaa_llll_llll_oooo_wwww_eeee_dddd _****_////
  158.           _tttt_iiii_dddd_[[[[_1111_]]]]_...._tttt_iiii______llll_eeee_vvvv_eeee_llll _==== _----_1111_;;;;    _////_**** _aaaa_nnnn_yyyy _llll_eeee_vvvv_eeee_llll _wwww_iiii_llll_llll _bbbb_eeee _aaaa_llll_llll_oooo_wwww_eeee_dddd _****_////
  159.           _iiii_oooo_cccc_...._iiii_cccc______cccc_mmmm_dddd _==== _IIII______TTTT_RRRR_CCCC_LLLL_OOOO_GGGG_;;;;
  160.           _iiii_oooo_cccc_...._iiii_cccc______tttt_iiii_mmmm_oooo_uuuu_tttt _==== _0000_;;;;
  161.           _iiii_oooo_cccc_...._iiii_cccc______llll_eeee_nnnn _==== _2222 _**** _ssss_iiii_zzzz_eeee_oooo_ffff_((((_ssss_tttt_rrrr_uuuu_cccc_tttt _tttt_rrrr_aaaa_cccc_eeee______iiii_dddd_ssss_))))_;;;;
  162.           _iiii_oooo_cccc_...._iiii_cccc______dddd_pppp _==== _((((_cccc_hhhh_aaaa_rrrr _****_))))_tttt_iiii_dddd_;;;;
  163.           _iiii_oooo_cccc_tttt_llll_((((_llll_oooo_gggg_,,,, _IIII______SSSS_TTTT_RRRR_,,,, _&&&&_iiii_oooo_cccc_))))_;;;;
  164.  
  165.      Example of submitting a _llll_oooo_gggg message (no arguments).
  166.  
  167.           _ssss_tttt_rrrr_uuuu_cccc_tttt _ssss_tttt_rrrr_bbbb_uuuu_ffff _cccc_tttt_llll_,,,, _dddd_aaaa_tttt_;;;;
  168.           _ssss_tttt_rrrr_uuuu_cccc_tttt _llll_oooo_gggg______cccc_tttt_llll _llll_cccc_;;;;
  169.           _cccc_hhhh_aaaa_rrrr _****_mmmm_eeee_ssss_ssss_aaaa_gggg_eeee _==== _""""_DDDD_oooo_nnnn_''''_tttt _ffff_oooo_rrrr_gggg_eeee_tttt _tttt_oooo _pppp_iiii_cccc_kkkk _uuuu_pppp _ssss_oooo_mmmm_eeee _mmmm_iiii_llll_kkkk
  170.                            _oooo_nnnn _tttt_hhhh_eeee _wwww_aaaa_yyyy _hhhh_oooo_mmmm_eeee_""""_;;;;
  171.           _cccc_tttt_llll_...._llll_eeee_nnnn _==== _cccc_tttt_llll_...._mmmm_aaaa_xxxx_llll_eeee_nnnn _==== _ssss_iiii_zzzz_eeee_oooo_ffff_((((_llll_cccc_))))_;;;;
  172.           _cccc_tttt_llll_...._bbbb_uuuu_ffff _==== _((((_cccc_hhhh_aaaa_rrrr _****_))))_&&&&_llll_cccc_;;;;
  173.           _dddd_aaaa_tttt_...._llll_eeee_nnnn _==== _dddd_aaaa_tttt_...._mmmm_aaaa_xxxx_llll_eeee_nnnn _==== _ssss_tttt_rrrr_llll_eeee_nnnn_((((_mmmm_eeee_ssss_ssss_aaaa_gggg_eeee_))))_;;;;
  174.           _dddd_aaaa_tttt_...._bbbb_uuuu_ffff _==== _mmmm_eeee_ssss_ssss_aaaa_gggg_eeee_;;;;
  175.           _llll_cccc_...._llll_eeee_vvvv_eeee_llll _==== _0000_;;;;
  176.           _llll_cccc_...._ffff_llll_aaaa_gggg_ssss _==== _SSSS_LLLL______EEEE_RRRR_RRRR_OOOO_RRRR_||||_SSSS_LLLL______NNNN_OOOO_TTTT_IIII_FFFF_YYYY_;;;;
  177.           _pppp_uuuu_tttt_mmmm_ssss_gggg_((((_llll_oooo_gggg_,,,, _&&&&_cccc_tttt_llll_,,,, _&&&&_dddd_aaaa_tttt_,,,, _0000_))))_;;;;
  178.  
  179. FFFFIIIILLLLEEEESSSS
  180.      _////_dddd_eeee_vvvv_////_llll_oooo_gggg
  181.      _////_dddd_eeee_vvvv_////_cccc_oooo_nnnn_ssss_llll_oooo_gggg
  182.      _<<<<_ssss_yyyy_ssss_////_llll_oooo_gggg_...._hhhh_>>>>
  183.      _<<<<_ssss_yyyy_ssss_////_ssss_tttt_rrrr_llll_oooo_gggg_...._hhhh_>>>>
  184.      _<<<<_ssss_yyyy_ssss_////_ssss_yyyy_ssss_llll_oooo_gggg_...._hhhh_>>>>
  185.  
  186.  
  187.  
  188.  
  189.  
  190.                                                                         PPPPaaaaggggeeee 3333
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197. lllloooogggg((((7777))))                                                                  lllloooogggg((((7777))))
  198.  
  199.  
  200.  
  201. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  202.      _ssss_tttt_rrrr_aaaa_cccc_eeee(1M), _ssss_tttt_rrrr_eeee_rrrr_rrrr(1M), _gggg_eeee_tttt_mmmm_ssss_gggg(2), _iiii_nnnn_tttt_rrrr_oooo(2), _pppp_uuuu_tttt_mmmm_ssss_gggg(2), _wwww_rrrr_iiii_tttt_eeee(2),
  203.      _cccc_llll_oooo_nnnn_eeee(7)
  204.  
  205. NNNNOOOOTTTTEEEESSSS
  206.      The _llll_oooo_gggg driver high and low water marks are tunable via the master file.
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.                                                                         PPPPaaaaggggeeee 4444
  257.  
  258.  
  259.  
  260.